package org.example.mallsystem1104.controller;

import org.example.mallsystem1104.common.Result;
import org.example.mallsystem1104.entity.Carousel;
import org.example.mallsystem1104.service.CarouselService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/api/carousel")
public class carouselController {

    @Resource
    private CarouselService carouselService;

    @GetMapping
    public Result findAll(){
        List<Carousel> list=carouselService.getAllCarousel();
        return Result.success(list);
    }

}
